import com.example.order.GoodsServiceApplication;
import com.example.order.IGoodsService;
import com.example.order.entity.TradeGoods;
import com.example.order.mapper.TradeGoodsMapper;
import com.example.order.utils.IDWorker;
import org.apache.ibatis.jdbc.Null;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mybatis.spring.boot.test.autoconfigure.MybatisTest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author: robert.song
 * @Date: Created in 2021/12/18
 */
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = {GoodsServiceApplication.class})
public class Initial {
    @Autowired
    private IGoodsService goodsService;

    @Resource
    private IDWorker idWorker;

    @Test
    public void test(){
        TradeGoods tradeGoods = new TradeGoods(idWorker.nextId(),"华为",1999,new BigDecimal(5000),"夜间拍照",new Date());
        goodsService.insert(tradeGoods);
    }
}
